﻿namespace corsor_game
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //设置坐标
            int x = 0;
            int y = 0;
            Console.BackgroundColor = ConsoleColor.Black;

            ConsoleKey input;
            do
            {
                Console.Clear();
                //设置坐标
                Console.SetCursorPosition(x, y);
                Console.Write("hello");
                //定义变量枚举型
                input = Console.ReadKey(true).Key;
                switch (input)
                {
                    //控制光标坐标加减
                    case ConsoleKey.A:
                        if (x > 0)
                            x--;
                        break;
                    case ConsoleKey.D:
                        if (x < 100)
                            x++;
                        break;
                    case ConsoleKey.W:
                        if (y > 0)
                            y--;
                        break;
                    case ConsoleKey.S:
                        if (y < 100)
                            y++;
                        break;
                    default:
                        break;

                }

            }
            while (input != ConsoleKey.Enter);
        }
    }
}